import { ResultEnum } from '../../enums/httpEnum'
import { Random } from 'mockjs'

const userInfo = {
  token: '666',
  data: {
    email: '',
    phoneNumber: '',
    userAccount: '123',
    userId: '11',
    userName: 'test'
  }
}
const currentUserInfo = {
  data: {
    email: '',
    phoneNumber: '',
    userAccount: '123',
    userId: '11',
    userName: 'test',
    channelCode: '1233'
  }
}
const menuInfo = {
  code: ResultEnum.SUCCESSCODE,
  message: '操作成功',
  result: [
    {
      childList: [
        {
          authorityName: '角色管理',
          functionUrl: 'roleManage'
        },
        {
          authorityName: '用户管理',
          functionUrl: 'userManage'
        },
        {
          authorityName: '用户管理2',
          functionUrl: 'systemUser2'
        },
        {
          authorityName: '渠道管理',
          functionUrl: 'channelManage'
        }
      ],
      authorityName: '系统管理',
      functionUrl: 'system'
    },
    {
      childList: [
        {
          authorityName: '企业管理',
          functionUrl: 'companyManage'
        },
        {
          authorityName: '租户管理',
          functionUrl: 'tenantManage'
        },
        {
          authorityName: '企业用户管理',
          functionUrl: 'tenantUser'
        }
      ],
      authorityName: '租户中心',
      functionUrl: 'tenant'
    },
    {
      childList: [
        {
          authorityName: '镜像管理',
          functionUrl: 'mirroringManage'
        },
        {
          authorityName: '命名空间',
          functionUrl: 'namespace'
        },
        {
          authorityName: '工作负载',
          functionUrl: 'workload'
        },
        {
          authorityName: '部署任务',
          functionUrl: 'deployTask'
        }
      ],
      authorityName: '部署/升级中心',
      functionUrl: 'deployUpgrade'
    },
    {
      childList: [
        {
          authorityName: '商品管理',
          functionUrl: 'goodsManage'
        },
        {
          authorityName: '套餐管理',
          functionUrl: 'packageManage'
        },
        {
          authorityName: '订单管理',
          functionUrl: 'orderManage'
        }
      ],
      authorityName: '商品中心',
      functionUrl: 'goods'
    },
    {
      childList: [
        {
          menuId: 0,
          authorityName: '菜单1',
          functionUrl: 'menu1',
          parentMenuId: 0,
          sortNum: 0,
          childList: [
            {
              menuId: 0,
              authorityName: '菜单1-1',
              functionUrl: 'menu2',
              parentMenuId: 0,
              sortNum: 0
            }
          ]
        },
        {
          menuId: 0,
          authorityName: '菜单2',
          functionUrl: 'menu3',
          parentMenuId: 0,
          sortNum: 0
        }
      ],
      menuId: 0,
      authorityName: '多级菜单',
      functionUrl: 'menu',
      parentMenuId: 0,
      sortNum: 0
    },
    {
      childList: [
        {
          icon: '',
          menuId: 0,
          authorityName: '标题',
          functionUrl: 'assemblyTitle',
          parentMenuId: 0,
          sortNum: 0
        },
        {
          icon: '',
          menuId: 0,
          authorityName: '图标',
          functionUrl: 'assemblyIcon',
          parentMenuId: 0,
          sortNum: 0
        },
        {
          icon: '',
          menuId: 0,
          authorityName: 'Loading 加载',
          functionUrl: 'assemblyLoading',
          parentMenuId: 0,
          sortNum: 0
        },
        {
          icon: '',
          menuId: 0,
          authorityName: '虚拟滚动条',
          functionUrl: 'assemblyScroll',
          parentMenuId: 0,
          sortNum: 0
        },

        {
          icon: '',
          menuId: 0,
          authorityName: '倒计时按钮',
          functionUrl: 'assemblyCountDown',
          parentMenuId: 0,
          sortNum: 0
        },
        {
          icon: '',
          menuId: 0,
          authorityName: '详情列表',
          functionUrl: 'assemblyDescriptions',
          parentMenuId: 0,
          sortNum: 0
        },
        {
          icon: '',
          menuId: 0,
          authorityName: '抽屉组件',
          functionUrl: 'assemblyDrawer',
          parentMenuId: 0,
          sortNum: 0
        },
        {
          icon: '',
          menuId: 0,
          authorityName: '弹窗组件',
          functionUrl: 'assemblyModal',
          parentMenuId: 0,
          sortNum: 0
        },
        {
          icon: '',
          menuId: 0,
          authorityName: '表单',
          functionUrl: 'assemblyForm',
          parentMenuId: 0,
          sortNum: 0
        },
        {
          icon: '',
          menuId: 0,
          authorityName: '表格',
          functionUrl: 'assemblyTable',
          parentMenuId: 0,
          sortNum: 0
        }
      ],
      menuId: 0,
      authorityName: '组件管理',
      functionUrl: 'assembly',
      parentMenuId: 0,
      sortNum: 0
    },
    {
      authorityName: '统计分析',
      functionUrl: 'statistics'
    }
  ],
  icon: '',
  menuId: 0,
  authorityName: '',
  functionUrl: '',
  parentMenuId: 0,
  sortNum: 0
}

const sysAccountActionListInquiry = {
  code: ResultEnum.SUCCESSCODE,
  message: '操作成功',
  result: [
    {
      authorityName: '新增',
      functionUrl: 'userAdd'
    },
    {
      authorityName: '编辑',
      functionUrl: 'userEdit'
    },
    {
      authorityName: '删除',
      functionUrl: 'userDel'
    },
    {
      authorityName: '查看',
      functionUrl: 'userView'
    },
    {
      authorityName: '重置密码',
      functionUrl: 'userResetPwd'
    },

    {
      authorityName: '新增',
      functionUrl: 'roleAdd'
    },
    {
      authorityName: '编辑',
      functionUrl: 'roleEdit'
    },
    {
      authorityName: '删除',
      functionUrl: 'roleDel'
    },
    {
      authorityName: '查看',
      functionUrl: 'roleView'
    },
    {
      authorityName: '新增',
      functionUrl: 'tenantUserAdd'
    },
    {
      authorityName: '状态',
      functionUrl: 'tenantUserStatus'
    },
    {
      authorityName: '删除',
      functionUrl: 'tenantUserDel'
    },
    {
      authorityName: '授权',
      functionUrl: 'tenantUserAuth'
    },
    {
      authorityName: '新增',
      functionUrl: 'tenantAdd'
    },
    {
      authorityName: '编辑',
      functionUrl: 'tenantEdit'
    },
    {
      authorityName: '删除',
      functionUrl: 'tenantDel'
    },
    {
      authorityName: '查看',
      functionUrl: 'tenantView'
    },
    {
      authorityName: '授权',
      functionUrl: 'tenantAuth'
    },
    {
      authorityName: '查看',
      functionUrl: 'channelView'
    },
    {
      authorityName: '编辑',
      functionUrl: 'channelEdit'
    },
    {
      authorityName: '启用',
      functionUrl: 'companyEnable'
    },
    {
      authorityName: '停用',
      functionUrl: 'companyUnable'
    },
    {
      authorityName: '导出',
      functionUrl: 'companyExport'
    },
    {
      authorityName: '导出',
      functionUrl: 'orderExport'
    },
    {
      authorityName: '查看',
      functionUrl: 'orderView'
    },
    {
      authorityName: '订单失效',
      functionUrl: 'orderCancel'
    }
  ]
}

const demoList = (() => {
  const result: any[] = []
  for (let index = 0; index < 2000; index++) {
    result.push({
      id: `${index}`,
      beginTime: '@datetime',
      endTime: '@datetime',
      address: '@city()',
      name: '@cname()',
      name1: '@cname()',
      name2: '@cname()',
      name3: '@cname()',
      name4: '@cname()',
      name5: '@cname()',
      name6: '@cname()',
      name7: '@cname()',
      name8: '@cname()',
      avatar: Random.image('400x400', Random.color(), Random.color(), Random.first()),
      date: `@date('yyyy-MM-dd')`,
      time: `@time('HH:mm')`,
      'no|100000-10000000': 100000,
      'status|1': ['normal', 'enable', 'disable']
    })
  }
  return result
})()
const tableList = {
  code: ResultEnum.SUCCESSCODE,
  message: '操作成功',
  result: {
    total: 50,
    records: demoList
  }
}
const getDictItem = (typeCode: string) => {
  let result: any[] = []
  if (typeCode === 'gaap') {
    result = [
      {
        id: 13,
        typeCode: 'gaap',
        parentId: 0,
        itemCode: '01',
        itemName: '企业会计准则-一般企业',
        itemDesc: null,
        sortIndex: null,
        status: 1,
        level: 1
      },
      {
        id: 14,
        typeCode: 'gaap',
        parentId: 0,
        itemCode: '02',
        itemName: '小企业会计准则',
        itemDesc: null,
        sortIndex: null,
        status: 1,
        level: 1
      }
    ]
  } else if (typeCode === 'service_type') {
    result = [
      {
        id: 15,
        typeCode: 'service_type',
        parentId: 0,
        itemCode: '01',
        itemName: '本地',
        itemDesc: null,
        sortIndex: null,
        status: 1,
        level: 1
      },
      {
        id: 16,
        typeCode: 'service_type',
        parentId: 0,
        itemCode: '02',
        itemName: '托管',
        itemDesc: null,
        sortIndex: null,
        status: 1,
        level: 1
      }
    ]
  } else if (typeCode === 'tax_plate_type') {
    result = [
      {
        id: 17,
        typeCode: 'tax_plate_type',
        parentId: 0,
        itemCode: '01',
        itemName: '税控盘(黑盘)',
        itemDesc: null,
        sortIndex: null,
        status: 1,
        level: 1
      },
      {
        id: 18,
        typeCode: 'tax_plate_type',
        parentId: 0,
        itemCode: '02',
        itemName: '金税盘(白盘)',
        itemDesc: null,
        sortIndex: null,
        status: 1,
        level: 1
      },
      {
        id: 19,
        typeCode: 'tax_plate_type',
        parentId: 0,
        itemCode: '03',
        itemName: '税务UKEY',
        itemDesc: null,
        sortIndex: null,
        status: 1,
        level: 1
      }
    ]
  }
  return {
    code: ResultEnum.SUCCESSCODE,
    message: '操作成功',
    result
  }
}
const platformIndustry = [
  {
    industryCode: '01',
    industryName: '林业'
  },
  {
    industryCode: '02',
    industryName: '农业'
  },
  {
    industryCode: '03',
    industryName: '畜牧业'
  }
]

const queryChannelList = [
  {
    channelCode: 'BIAO_PU_YUN',
    channelName: '标普云'
  },
  {
    channelCode: 'STPX63',
    channelName: '张三渠道1'
  },
  {
    channelCode: 'XM6WGY',
    channelName: '渠道AAA'
  },
  {
    channelCode: 'V76BWA',
    channelName: '张三新渠道'
  },
  {
    channelCode: 'CBEXP8',
    channelName: '渠道B'
  },
  {
    channelCode: 'WYPLBD',
    channelName: '渠道C'
  },
  {
    channelCode: 'TKEVTM',
    channelName: '渠道D'
  },
  {
    channelCode: 'WAU44E',
    channelName: '渠道20230616'
  },
  {
    channelCode: 'WaFVnp',
    channelName: '测试渠道16881214460001'
  },
  {
    channelCode: 'ntYawd',
    channelName: '测试渠道零零零三'
  },
  {
    channelCode: 'uJSf43',
    channelName: '测试渠道零零零二'
  }
]
export default {
  userInfo,
  currentUserInfo,
  menuInfo,
  getDictItem,
  platformIndustry,
  queryChannelList,
  tableList,
  sysAccountActionListInquiry
}
